#include "Lanes.h"

namespace OpenDrive {
	Lanes::Lanes(){	}

	Lanes::~Lanes(){}

	void Lanes::addLaneSections(const LaneSection &laneSection){
		laneSections.push_back(laneSection);
	}

	std::vector<LaneSection>& Lanes::getLaneSections(){
		return laneSections;
	}

	void Lanes::addLaneOffsets(const LaneOffset &lo){
		laneOffsets.push_back(lo);
	}

	std::vector<LaneOffset>& Lanes::getLaneOffsets(){
		return laneOffsets;
	}

	bool Lanes::laneSectionExist(int laneSectionId) const{
		if (laneSectionId >= laneSections.size() || laneSectionId < 0)
			return false;
		return true;
	}

	bool Lanes::laneExist(int laneSectionId, int laneId) const
	{
		return laneSectionExist(laneSectionId) && laneSections[laneSectionId].laneExist(laneId);
	}

	LaneSection&  Lanes::getLaneSectionById(int laneSectionId) {
		return laneSections[laneSectionId];
	}

	Lane & Lanes::getLane(int laneSectionId,int laneId)
	{
		return laneSections[laneSectionId].getLaneByLaneId(laneId);
	}

	int Lanes::getLaneSectionsSize()const{
		return laneSections.size();
	}

	int Lanes::getLaneOffsetsSize()const{
		return laneOffsets.size();
	}
}